package cn.lili.modules.promotion.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.member.entity.dos.User;
import cn.lili.modules.promotion.fallback.CouponActivityFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author: ftyy
 * @date: 2022-01-13 18:11
 * @description: 优惠券活动Client
 */
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.PROMOTION_SERVICE, contextId = "coupon-activity", fallback =
        CouponActivityFallback.class)
public interface CouponActivityClient {

    /**
     * 注册赠券
     *
     * @param member 会员
     */
    @PostMapping("/feign/promotion/coupon-activity/registered")
    void registered(@RequestBody User member);

    /**
     * 指定优惠券立即赠送
     *
     * @param couponActivityId 优惠券活动ID
     */
    @PutMapping("/feign/promotion/coupon-activity/specifyCoupon")
    void specifyCoupon(@RequestBody String couponActivityId);
}
